<template>
  <div class="form-item">
    <div class="label">
      {{ label }}
    </div>

    <textarea
      class="textarea" :placeholder="placeholder" auto-height
      :value="value" placeholder-style="color: #999;" @input="handleInput"
    ></textarea>
  </div>
</template>

<script>
export default {
  name: 'ZeTextarea',
  props: {
    label: { type: String, default: '' },
    placeholder: { type: String, default: '请输入' },
    value: { type: String, default: '' },
  },
  methods: {
    handleInput(e) {
      this.$emit('input', e.detail.value)
    },
  },
}
</script>

<style lang="scss" scoped>
.form-item {
  font-size: 14px;
  font-weight: 400;
  line-height: 14px;
  padding: 15px 0;
  display: flex;
  flex-direction: column;
  row-gap: 15px;

  .label {
    color: #333333;
  }

  .textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 100px;
    background-color: #F9F8F8;
    padding: 10px;
  }
}
</style>
